<?php
class LienHeController extends Zend_Controller_Action
{

    public function init()
    {
          $this->_helper->layout->setLayout('layout');
    }

    public function indexAction()
    {
    	
    }

    public function themAction()
    {
    	$this->view->title = 'Hỏi đáp - Góp ý  ?';
    	$formThem = new Admin_Form_LienHeForm();
    	$formThem->setMethod('post');
    	$formThem->setAction('/zfMHB/public/lienhe/them');
    	
    	$formThem->addElement('submit', 'submit', array('label' => 'Gởi'));
    	
    	$this->view->form = $formThem;
    	
    	if($this->getRequest()->isPost()){
    		if($formThem->isValid($_POST)){
    			$data = $formThem->getValues();
    			
    			$hovaten 		= $data['hovaten'];
    			$diachi 			= $data['diachi'];
    			$email		= $data['email'];
    			$linhvuc 			= $data['linhvuc'];
    			$tieude			= $data['tieude'];
				$noidung		= $data['noidung'];
				
    			$lienheMapper = Library_Model_LienHeMapper::getInstance();
    			$lienheObj 	= new Library_Model_LienHe();
    			    			
    			$lienheObj->setHovaten($hovaten);
    			$lienheObj->setDiachi($diachi);
    			$lienheObj->setEmail($email);
    			$lienheObj->setLinhvuc($linhvuc);
				$lienheObj->setTieude($tieude);
				$lienheObj->setNoidung($noidung);
				
    			$lienhe = $lienheMapper->save($lienheObj);
    			$this->_redirect('/index');
    		}
    	}
    }



    
}









		
		
		
		
		
		
		